export const formComponentConfig = {
  inputModal: () => import('@/common/components/search-modal/input-modal.vue'),
  categoryName: () =>
    import('@/common/components/search-modal/categoryName.vue'),
  dictSelect: () => import('@/common/components/dict-select/index.vue'),
  dataPicker: () => import('./data-picker.vue'),
};

export const formRenderConfig = (mdsItemType: any) => {
  return {
    projectNo: {
      label: '项目号',
      field: 'projectCode',
      componentName: 'inputModal',
      componentProps: {
        title: '项目号',
        type: 'materialCode',
        labelName: 'materialCode',
        valueName: 'materialCode',
        defaultQuery: {
          materialType: '6',
        },
      },
    },
    product: {
      label: '机型/产品',
      field: 'product',
      componentName: 'inputModal',
      componentProps: {
        title: '机型/产品',
        type: 'materialCode',
        labelName: 'materialCode',
        valueName: 'materialCode',
        defaultQuery: {
          materialType: '6',
          materialStatus: '1,3',
        },
      },
    },
    materialCode: {
      label: '物料编码',
      field: 'materialCode',
      componentName: 'inputModal',
      componentProps: {
        title: '物料编码',
        type: 'materialCode',
        labelName: 'materialCode',
        valueName: 'materialCode',
        defaultQuery: {
          materialType: mdsItemType,
        },
      },
    },
    categoryName: {
      label: '品类名称',
      field: 'categoryName',
      componentName: 'categoryName',
      componentProps: {
        title: '品类名称',
        type: 'categoryName',
        labelName: 'categoryName',
        valueName: 'categoryName',
      },
    },
    batch: {
      label: '批次',
      field: 'batchNo',
      componentName: 'input',
    },
    units: {
      label: '架次/台份',
      field: 'manufactureLotNo',
      componentName: 'input',
    },
    categoryType: {
      label: '物料类型',
      field: 'materialType',
      componentName: 'dictSelect',
      componentProps: {
        dictType: 'mdsType',
      },
    },
    paiHao: {
      label: '牌号',
      field: 'substanceBrand',
      componentName: 'inputModal',
      componentProps: {
        title: '牌号',
        type: 'materialCode',
        labelName: 'materialCode',
        valueName: 'materialCode',
      },
    },
    guiGe: {
      label: '规格',
      field: 'specification',
      componentName: 'inputModal',
      componentProps: {
        title: '规格',
        type: 'materialCode',
        labelName: 'materialCode',
        valueName: 'materialCode',
      },
    },
    supplier: {
      label: '供应商',
      field: 'supplierCode',
      componentName: 'inputModal',
      componentProps: {
        title: '供应商',
        type: 'supplyName',
        labelName: 'supplierCode',
        valueName: 'supplierCode',
      },
    },
    type: {
      label: '型号',
      field: 'productTypeNo',
      componentName: 'inputModal',
      componentProps: {
        title: '型号',
        type: 'materialCode',
        valueName: 'modelMark',
        labelName: 'modelMark',
      },
    },
    productParent: {
      label: '成品父型号',
      field: 'productSuperTypeNo',
      componentName: 'input',
    },
    // startDate: {
    //   label: '汇总时间(起)',
    //   field: 'gatherDateStart',
    //   componentName: 'dataPicker',
    // },
    // endDate: {
    //   label: '汇总时间(止)',
    //   field: 'gatherDateEnd',
    //   componentName: 'dataPicker',
    // },
    editDate: {
      label: '汇总时间',
      field: 'editStartDateArr',
      componentName: 'dateRangPicker',
      formItemProps: {
        // class: 'data-range',
        style: 'width: 605px !important',
      },
      componentProps: {
        valueKey: ['gatherDateStart', 'gatherDateEnd'],
      },
    },
    queRenRen: {
      label: '确认人',
      field: 'confirmUserCode',
      componentName: 'input',
    },
    laiyuan: {
      label: '需求来源',
      field: 'requireSourceType',
      componentName: 'dictSelect',
      componentProps: {
        dictType: 'requireSourceType',
      },
    },
    waibao: {
      label: '外包提出单位',
      field: 'outSourceDeptCode',
      componentName: 'input',
    },
    yiji: {
      label: '一级品类',
      field: 'categoryLv1Id',
      componentName: 'input',
    },
    erji: {
      label: '二级品类',
      field: 'categoryLv2Id',
      componentName: 'input',
    },
    sanji: {
      label: '三级品类',
      field: 'categoryLv3Id',
      componentName: 'input',
    },
    tuhao: {
      label: '图号',
      field: 'picNo',
      componentName: 'inputModal',
      componentProps: {
        title: '零组件图号',
        type: 'materialCode',
        labelName: 'figureNumber',
        valueName: 'figureNumber',
      },
    },
    lingzujiantuhao: {
      label: '零组件图号',
      field: 'partPicNo',
      componentName: 'inputModal',
      componentProps: {
        title: '零组件图号',
        type: 'materialCode',
        labelName: 'figureNumber',
        valueName: 'figureNumber',
      },
    },
    jiagongneirong: {
      label: '加工内容',
      field: 'machineContent',
      componentName: 'input',
    },
    tuhaobanben: {
      label: '图号版本',
      field: 'picNoVersion',
      componentName: 'input',
    },
    gongyizhuangtaihao: {
      label: '工艺状态号',
      field: 'processStateNo',
      componentName: 'input',
    },
    fengongluxian: {
      label: '分工路线',
      field: 'divideRoute',
      componentName: 'input',
    },
  };
};
